//-----------------------------------------------------------------------------
// <copyright file="PluginEventArgs.cs" company="Justin Wallace Saunders">
//     Copyright (c) Microsoft Public License. All rights reserved.
// </copyright>
// <author name="Justin Wallace Saunders" email="justinsa@live.ca" />
//-----------------------------------------------------------------------------
namespace Community.Tools.Plugins
{
    using System;

    /// <summary>
    /// The base class for all EventArgs that are raised by IPlugins.
    /// </summary>
    public class PluginEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the PluginEventArgs class.
        /// </summary>
        /// <param name="plugin">The plugin that raised the initial event.</param>
        /// <exception cref="System.ArgumentNullException">Thrown when the <paramref name="Plugin"/> is null.</exception>
        public PluginEventArgs(IPlugin plugin) : base()
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            this.Plugin = plugin;
        }

        /// <summary>
        /// Gets the plug-in that raised the initial event.
        /// </summary>
        public IPlugin Plugin { get; private set; }
    }
}
